package com.situ.spring.service.impl;

import com.situ.spring.dao.ICourseDao;
import com.situ.spring.service.ICourseService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

//<bean name="courseService" class="com.situ.spring.service.impl.CourseServiceImpl">
//  <property name="courseDao" ref="courseDao"/>
//</bean>
@Service("courseService")
public class CourseServiceImpl implements ICourseService {

    //<property name="courseDao" ref="courseDao"/>
    @Resource(name = "courseDao")
    private ICourseDao courseDao;

    //@Transactional
    @Override
    public void selectAll() {
        System.out.println("CourseServiceImpl.selectAll");
        courseDao.selectAll();

        //开启事物
        // A: -100
        // B: +100
        //关闭事物
    }
}
